package com.ydt.dockingclients.utils;

import jakarta.servlet.http.HttpServletRequest;

import java.io.BufferedReader;

public class HttpServletRequestReader {
    public static String getBody(HttpServletRequest request) {
        StringBuilder stringBuilder = new StringBuilder();
        String line;
        try {
            BufferedReader reader = request.getReader();
            while ((line = reader.readLine()) != null) {
                stringBuilder.append(line);
            }
            return stringBuilder.toString();
        } catch (Exception e) {
            return null;
        }

    }
}
